package Controller;

import Helper.*;
import Model.*;

public class AdminController {
    private static Admin a = null;

    public static boolean login(String username, String password){
        AdminM adminM = new AdminM();

        a = adminM.login(username, password);

        if( a != null ){
            Helper.setSession(0, a.name);

            return true;
        }else{
            Helper.waitter();

            return false;
        }
    }

    public static boolean addProduct(String name, float price, int amount){
        return a.addProduct(name, price, amount);
    }

    public static boolean editProduct(int id, String name, float price, int amount){
        return a.editProduct(id, name, price, amount);
    }

    public static boolean removeProduct(int id){
        return a.removeProduct(id);
    }
}
